home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 1.9 KB | 81 lines | [TEXT/CWIE] |
- // HFSStoreStream.h
- // Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
-
- // Implements IAStoreStream for a Macintosh HFS file.
-
- #pragma once
- #ifndef HFSStoreStream_h
- #define HFSStoreStream_h
-
- #pragma import on
-
- #include "IAStoreStream.h"
-
- //#pragma IA_BEGIN_IMPORTS
- #include <Files.h>
- //#pragma IA_END_IMPORTS
-
- #pragma IA_BEGIN_EXPORTS
-
- class HFSStoreStream : public IAStoreStream {
- public:
- HFSStoreStream(short vRef, long dirId, const StringPtr fileName,
- OSType creator = 'VTWN', OSType fileType = 'STOR');
- ~HFSStoreStream();
-
- void Initialize();
- void Open(bool writable);
-
- bool IsOpen();
- bool IsWritable();
-
- void Flush();
-
- uint32 GetEOF();
- void SetEOF(uint32 address);
-
- virtual IAStoreStream* Clone();
-
- OSType GetCreator() const {return creator;}
- OSType GetFileType() const {return fileType;}
- const short GetVRefNum() const {return vRefNum;}
- const long GetDirID() const {return dirID;}
- StringPtr GetFileName() const {return fileName;}
- short GetFRefNum() const {return fRefNum;}
- void SetFRefNum(short fref) {fRefNum = fref;} // better be open!
-
- protected:
- // constructor for use by Clone()
- HFSStoreStream(short vRef, long dirId, const StringPtr fileName,
- OSType creator, OSType fileType, bool isOpen, bool isWritable,
- short fRefNum);
-
- void Write(uint32 address, const byte* data, uint32 length);
- uint32 Read(uint32 address, byte* data, uint32 length);
-
- private:
- HFSStoreStream(HFSStoreStream&); // don't define a copy constructor
-
- bool isOpen;
- bool isWritable;
- const bool isClone;
-
- // for use by Initialize()
- const OSType creator;
- const OSType fileType;
- // for use by Initialize() and Open()
- const short vRefNum;
- const long dirID;
- StringPtr fileName;
- // handle on the open file, for remaining methods
- short fRefNum;
-
- };
-
- #pragma IA_END_EXPORTS
-
- #pragma import reset
-
- #endif
-